package zd.cornermemory.db;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.io.Serializable;

import zd.cornermemory.utils.Statistics;

/**
 * Created by zhud on 2020/5/19.
 */
@Entity
public class Cj implements Comparable<Cj>,Serializable{
    @Id(autoincrement = true)
    private Long id;

    private Long singTime;//成绩 秒数

    private Long date; //当前时间

    private int status;//0 无惩罚 1 +2  2 DNF

    private String code;//打乱公式

    private String etnote;//备注

    private int group;//分组

    private static final long serialVersionUID = 1L;

    @Generated(hash = 783805437)
    public Cj(Long id, Long singTime, Long date, int status, String code,
            String etnote, int group) {
        this.id = id;
        this.singTime = singTime;
        this.date = date;
        this.status = status;
        this.code = code;
        this.etnote = etnote;
        this.group = group;
    }

    @Generated(hash = 1184427602)
    public Cj() {
    }

    public Cj(Long singTime, int status) {
        this.singTime = singTime;
        this.status = status;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSingTime() {
        return this.singTime;
    }

    public void setSingTime(Long singTime) {
        this.singTime = singTime;
    }

    public Long getDate() {
        return this.date;
    }

    public void setDate(Long date) {
        this.date = date;
    }

    public int getStatus() {
        return this.status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }


    @Override
    public String toString() {
        return "Cj{" +
                "id=" + id +
                ", singTime=" + Statistics.timeToString(singTime.intValue()) +
                ", date=" + date +
                ", status=" + status +
                ", code='" + code + '\'' +
                ", etnote='" + etnote + '\'' +
                ", group=" + group +
                '}';
    }

    @Override
    public int compareTo(Cj o) {
        return singTime.intValue()-o.getSingTime().intValue();
    }

    public String getEtnote() {
        return this.etnote;
    }

    public void setEtnote(String etnote) {
        this.etnote = etnote;
    }

    public int getGroup() {
        return this.group;
    }

    public void setGroup(int group) {
        this.group = group;
    }
}
